import {defineStore}   from "pinia";
import {ref}  from "vue";

export const useTokenStore = defineStore('token',()=>{
    //定义描述token
    const token = ref('');
    //定义修改token
    const setToken = (value) => {
        token.value = value;
    }
    //定义移除token
    const removeToken = () => {
        token.value = '';
    }

    return {
        token,setToken,removeToken
    }
},
{
    persist: true //持久化存储
}
)
